// app/routes/userRoutes.js

const express = require('express');
const router = express.Router();
const userController = require('../controllers/UserController');

// 获取所有用户
router.get('/', userController.getAllUsers);

// 根据 ID 获取用户
router.get('/:id', userController.getUserById);

// 创建新用户
router.post('/', userController.createUser);

// 更新用户
router.post('/:id/edit', userController.updateUser);
// 显示编辑页面
router.get('/:id/edit', userController.getEditUserPage);


// 显示删除确认页面
router.get('/:id/delete', userController.getDeleteUserPage);
router.delete('/:id/deleteuser', userController.deleteUser);
module.exports = router;